$(document).ready(function() {
	var remoteTrans = new Helper.RemoteTrans({
		loading:false,
		url:Helper.basePath+"/login.htm",
		onError:function(json){
			//Helper.login.checkcode('checkcode_img');
			Helper.message(json.message);
		},
		onSuccess:function(json) {
			//Helper.login.checkcode('checkcode_img');
			if(json.message) {
				location.href = json.message;
			}else {
				location.href = Helper.basePath + "/index.jsp";
			}
		}
	});
	
	$("#subfrm").click(function(){
		//if(Helper.login.validata($("#checkcode").val()))
		//{
		
		if ($("#username").val() == null || $("#username").val() == "") {
			alert("请输入登录名");
			return false;
		}
		if ($("#password").val() == null || $("#password").val() == "") {
			alert("请输入密码");
			return false;
		}
		remoteTrans.params = {username:$("#username").val().trim(),password:$("#password").val()};
		var url = Helper.paramsHtml("url");
		if(url) {
			remoteTrans.addParameters("url",url);
		}
		remoteTrans.send();
		//}
	});
});